#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long
#define stoorz_and_QuantAsk using
#define AK namespace
#define IOI_and_Jayun_is_stupid std

stoorz_and_QuantAsk AK IOI_and_Jayun_is_stupid;

const int N = 2e5 + 10;

inline ll Read()
{
	ll x = 0, f = 1;
	char c = getchar();
	while (c != '-' && (c < '0' || c > '9')) c = getchar();
	if (c == '-') f = -f, c = getchar();
	while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0', c = getchar();
	return x * f;
}

int n;
int a[N];
bool b[N];

int main()
{
	freopen("fruit.in", "r", stdin);
	freopen("fruit.out", "w", stdout);
	n = Read();
	for (int i = 1; i <= n; i++) a[i] = Read();
	for (int ans = 0; ans < n; )
	{
		a[0] = 4;
		for (int i = 1, lst = 0; i <= n; i++)
		{
			if (a[i] == 3) continue;
			if (a[i] != a[lst]) printf ("%d ", i), b[i] = 1, ans++;
			lst = i;
		}
		putchar(10);
		for (int i = 1; i <= n; i++)
			if (b[i]) a[i] = 3;
	}
	return 0;
}
/*
#include <cmath>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long
#define stoorz_and_QuantAsk using
#define AK namespace
#define IOI_and_Jayun_is_stupid std

stoorz_and_QuantAsk AK IOI_and_Jayun_is_stupid;

const int N = 2e5 + 10;

inline ll Read()
{
	ll x = 0, f = 1;
	char c = getchar();
	while (c != '-' && (c < '0' || c > '9')) c = getchar();
	if (c == '-') f = -f, c = getchar();
	while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0', c = getchar();
	return x * f;
}

int n;
int a[N];
vector <int> b[N];
int root = 1, nxt[N], lst[N], m, snxt[N], slst[N];

int main()
{
	freopen("fruit3.in", "r", stdin);
//	freopen("fruit.out", "w", stdout);
	n = Read();
	for (int i = 1; i <= n; i++) 
	{
		a[i] = Read();
		if (a[i] != a[i - 1])
			nxt[m] = m + 1, lst[m + 1] = m, m++;
		b[m].push_back(i);
	}
	for (int ans = 0; ans < n; )
	{
		for (int i = root; i > 0 && i <= m; i = nxt[i])
		{
			if (slst[i]) continue;
			int siz = b[i].size();
			if (siz == 1)
			{
				if(!snxt[i])
				{
					lst[nxt[i]] = lst[i];
					nxt[lst[i]] = nxt[i];
					if (i == root) root = nxt[i];
				} else
				{
					slst[snxt[i]] = 0;
					lst[nxt[i]] = snxt[i];
					nxt[lst[i]] = snxt[i];
					nxt[snxt[i]] = nxt[i];
					lst[snxt[i]] = lst[i];
					if (i == root) root = snxt[i];
				}
			}
			int j = i;
			if(b[j].size())printf ("%d ", b[j][0]), ans++, b[j].erase(b[j].begin());
		}
		for (int i = nxt[root]; i > 0 && i <= m; i = nxt[i])
			if (a[b[i][0]] == a[b[lst[i]][0]]) 
			{
				snxt[lst[i]] = i;
				slst[i] = lst[i];
				nxt[lst[i]] = nxt[i];
//				lst[nxt[i]] = lst[i];
			}
		for (int i = nxt[root]; i > 0 && i <= m; i = nxt[i])
			if(snxt[i]) lst[nxt[snxt[i]]] = i;
		putchar(10);
	}
	return 0;
}
*/

